using System.ComponentModel.DataAnnotations;

namespace Mark.Models;

/// <summary>
/// 用户实体
/// </summary>
public class User : BaseEntity
{
    [Required]
    [MaxLength(100)]
    public string Username { get; set; } = string.Empty;
    
    [MaxLength(100)]
    public string? Email { get; set; }
    
    [MaxLength(100)]
    public string? DisplayName { get; set; }
    
    [MaxLength(500)]
    public string? Avatar { get; set; }
    
    /// <summary>
    /// 用户偏好设置 (JSON)
    /// </summary>
    public string? Preferences { get; set; }
    
    /// <summary>
    /// 用户状态：Active, Inactive, Suspended
    /// </summary>
    [MaxLength(20)]
    public string Status { get; set; } = "Active";
    
    /// <summary>
    /// 最后登录时间
    /// </summary>
    public DateTime? LastLoginAt { get; set; }
    
    // 导航属性
    public virtual ICollection<Conversation> Conversations { get; set; } = new List<Conversation>();
    public virtual ICollection<FileInfo> Files { get; set; } = new List<FileInfo>();
} 